<div id="sanpham_right">
           	    <div id="title_right">
            		<p id="title_right_left"></p>
            		<div id="title_right_center">
            		  <p class="chu_title">HÓA ĐƠN</p>
            		</div>
           			<p id="title_right_right"></p>
             	</div>
                <div id="noidung_right">

<?php if($data){ ?>
			<table width = "700" cellpadding = "2" cellspacing = "2" border = "0" align = "center" bgcolor = "#D4D0C8">
			<tr > 
				<td width = "200" valign = "top"> <div align = "center"> <b>Tên Khách Hàng</b> </div> </td>
				<td width = "200" valign = "top"> <div align = "center"> <b>Ngày Lập</b> </div> </td>
				<td width = "200" valign = "top"> <div align = "center"> <b> Người Lập </b> </div> </td>
				<td width = "200" valign = "top"> <div align = "center"> <b> Tình Trạng </b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <img src="public/images/b_edit.png"/> Sửa</div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <img src="public/images/b_drop.png"/> Xóa </div> </td>
			</tr>
			<?php foreach ($data['listhd'] as $key => $value) { ?>
			<tr> 
				<td width = "200" valign = "top"> <div align = "center">
				<?php
				if(is_array($data['listkh'])){
					foreach ($data['listkh'] as $item){
						if($item['MaKH']==$value['MaKH']){ 
							echo $item['TenKH'];
						}
					}
				}
				?> </div> </td>
				<td width = "200" valign = "top"> <div align = "center"><?php echo $value['NgayLap'];?> </div> </td>
				<td width = "200" valign = "top"> <div align = "center"><?php echo $value['NguoiLap'];?> </div> </td>
				<td width = "200" valign = "top"> <div align = "center"><?php if($value['TinhTrang']==0)
				echo "Chưa duyệt";
				else 
				echo "Đã duyệt";
				?> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <a href = "admin.php?mod=edit_hoadon&id=<?php echo $value['MaHD'];?>"> Sửa </a></div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <a href = "admin.php?mod=del_hoadon&id=<?php echo $value['MaHD'];?>"> Xóa </a> </div> </td>
			</tr>
			<?php
				}		
			?>
		</table>
<?php 
	}
?>
</div>
</div>